﻿using System;
using System.Collections.Generic;
using System.Text;

using Model;
using DAO;
using System.Collections; 


/**
 * 作者：陈杰
 * QQ  : 710782046
 * Email:ovenjackchain@gmail.com
 * Web :http://www.qidian10.com
 */
namespace BLL
{
    public class newsinfoMgr
    {
        newsinfoDao newsinfoDao = new newsinfoDao();
        

        /// <summary>
        /// 根据条件获得该页的记录
        /// </summary>
        /// <param name="start">开始号</param>
        /// <param name="limit">分页大小</param>
        /// <param name="Fields">查询关键字</param>
        /// <param name="query">查询内容</param>
        /// <returns></returns>
        public IList<newsInfo> FindAllByPage_newsinfo(string start, string limit, string conditions)
        {
            CJSearchSql CJSearchSql = new CJSearchSql();
            return newsinfoDao.FindAllByPage_newsinfo(start, limit, CJSearchSql.GetConditonSQL(conditions));
        }

        /// <summary>
        /// 获得该条件的记录总条数
        /// </summary>
        /// <param name="Fields">查询关键字</param>
        /// <param name="query">查询内容</param>
        /// <returns></returns>
        public string GetRecordCount_newsinfo(string conditions)
        {
            CJSearchSql CJSearchSql = new CJSearchSql();
            return newsinfoDao.GetCount_newsinfo(CJSearchSql.GetConditonSQL(conditions));
        }

        /// <summary>
        /// 根据类别查找记录
        /// </summary>
        /// <param name="classify"></param>
        /// <returns></returns>
        public IList<newsInfo> FindNewsinfoByClassify(string classify)
        {
            return newsinfoDao.FindNewsinfoByClassify(classify);
        }

        /// <summary>
        /// 根据id查找指定记录
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public newsInfo FindById_newsinfo(int id)
        {
            return newsinfoDao.FindById_newsinfo(id);
        }

        /// <summary>
        /// 添加新纪录
        /// </summary>
        /// <param name="newsinfo"></param>
        /// <returns></returns>
        public bool Add_newsinfo(newsInfo newsinfo)
        {
            return newsinfoDao.Add_newsinfo(newsinfo);
        }

        /// <summary>
        /// 删除记录
        /// </summary>
        /// <param name="newsinfo"></param>
        /// <returns></returns>
        public bool Del_newsinfo(newsInfo newsinfo)
        {
            return newsinfoDao.Del_newsinfo(newsinfo);
        }

        /// <summary>
        /// 更新记录
        /// </summary>
        /// <param name="newsinfo"></param>
        /// <returns></returns>
        public bool Update_newsinfo(newsInfo newsinfo)
        {
            return newsinfoDao.Update_newsinfo(newsinfo);
        }
       
    }
}
